﻿using System;
using System.Runtime.Serialization;

namespace PoolKit
{
    /// <summary>
    /// Indicates a resource creation failure
    /// </summary>
    [Serializable]
    public class FailedToConstructResourceException : PoolOperationException
    {
        /// <summary>
        /// Creates a new instance of <see cref="FailedToConstructResourceException"/>.
        /// </summary>
        public FailedToConstructResourceException()
        {
        }

        /// <summary>
        /// Creates a new instance of <see cref="FailedToConstructResourceException"/>.
        /// </summary>
        /// <param name="message">Error message</param>
        public FailedToConstructResourceException(string message) : base(message)
        {
        }

        /// <summary>
        /// Creates a new instance of <see cref="FailedToConstructResourceException"/>.
        /// </summary>
        /// <param name="message">Error message</param>
        /// <param name="inner">Exception to wrap - the one that caused this one</param>
        public FailedToConstructResourceException(string message, Exception inner) : base(message, inner)
        {
        }

        /// <summary>
        /// Creates a new instance of <see cref="FailedToConstructResourceException"/>.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected FailedToConstructResourceException(
            SerializationInfo info,
            StreamingContext context) : base(info, context)
        {
        }
    }
}